package algorithm.poj.p3000;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLDecoder;
import java.util.StringTokenizer;


/**
 * 分析：
 * 实现：
 * 经验：
 * 教训：
 * 一开始用了分治，结果TLE，再分析分析，其实数据量不大，直接上搜索就OK了
 * 
 * 分类：暴搜 
 * 
 * @author wong.tong@gmail.com
 *
 */
public class P3740 {

	public static void main(String[] args) throws Exception {

//		long start = System.currentTimeMillis(); 
		InputStream input = null;
		if (false) {
			input = System.in;
		} else {
			URL url = P3740.class.getResource("P3740.txt");
			File file = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
			input = new FileInputStream(file);
		}
		
		BufferedReader stdin = new BufferedReader(new InputStreamReader(input));
		
		String line = stdin.readLine();
		while (line != null) {
			StringTokenizer st = new StringTokenizer(line);
			int M = Integer.valueOf(st.nextToken());
			int N = Integer.valueOf(st.nextToken());
			char[][] ds = new char[M][];
			for (int i = 0; i < M; i ++) {
				ds[i] = new char[N];
				st = new StringTokenizer(stdin.readLine());
				for (int j = 0; j < N; j ++) {
					ds[i][j] = st.nextToken().charAt(0);
				}
			}
			
			if (find(ds) != null) {
				System.out.println("Yes, I found it");
			} else {
				System.out.println("It is impossible");
			}
			line = stdin.readLine();
		}
//		System.out.println((System.currentTimeMillis() - start) + " ms");
	}

	private static int[] find(char[][] ds) {
		
		int[] rows = new int[0];
		int M = ds.length;
		int N = ds[0].length;
		while ((rows = next(rows, M)) != null) {
			boolean good = true;
			for (int i = 0; i < N; i ++) {
				int c = 0;
				for (int j = 0; j < rows.length; j ++) {
					if (ds[rows[j]][i] == '1') c++;
				}
				if (c != 1) {
					good = false;
					break;
				}
			}
			if (good) {
				return rows;
			}
		}
		return null;
	}
	
	/**
	 * 获得当前组合c的下一个组合。
	 * 利用该函数可以依次获得[0, M)的所有组合
	 * @param c
	 * @param M
	 * @return
	 */
	private static int[] next(int[] c, int M) {

		int index = c.length-1;
		for (; index > -1; index --) {
			if (c[index] < M-(c.length-index)) {
				c[index] ++;
				for (int i = index+1; i < c.length;i ++) {
					c[i] = c[index] + i - index;
				}
				break;
			}
		}
		if (index == -1) {
			if (c.length < M) {
				int[] nc = new int[c.length+1];
				for (int i = 0; i < nc.length; i ++) {
					nc[i] = i;
				}
				return nc;
			} else {
				return null;
			}
		} else {
			return c;
		}
	}
}